//24c02.h
#pragma once

/*24c02是一个2K bit的串行EEPROM,含256个字节,8字节的页写缓冲器*/
#include <Arduino.h>

/* 引脚定义 */
#define IIC_SCL     42
#define IIC_SDA     41

#define EEPROM_ADDR 0x50    /* 7位器件地址 */

void at24c02_init();
void at24c02_write_one_byte(uint8_t addr, uint8_t data);
uint8_t at24c02_read_one_byte(uint8_t addr);
void at24c02_write_bytes(uint8_t addr, const char *data, uint8_t len);
void at24c02_read_bytes(uint8_t addr, uint8_t *pbuf, uint8_t len);
bool at24c02_check(void);
